import Layout from '@/layout/index.vue'
import type { RouteRecordRaw } from 'vue-router'

export const staticRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/login/index.vue'),
    meta: {
      ignoreAuth: true,
    },
  },
  {
    path: '/qrCodeLogin',
    name: 'QrCodeLogin',
    component: () => import('@/views/login/qrCodeLogin/index.vue'),
    meta: {
      ignoreAuth: true,
    },
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/login/register/index.vue'),
    meta: {
      ignoreAuth: true,
    },
  },
  {
    path: '/:catchAll(.*)',
    name: 'NotFound',
    component: () => import('@/views/error/notFound.vue'),
    meta: {
      ignoreAuth: true,
    },
  },
]

export const rootRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Root',
    component: Layout,
  },
]

export const adminRoutes: RouteRecordRaw[] = [
  {
    path: '/historyRecord',
    name: 'HistoryRecord',
    component: () => import('@/views/admin/historyRecord/index.vue'),
    meta: {
      title: '历史测试记录',
      role: 'admin',
    },
  },
  {
    path: '/singleRecord',
    name: 'SingleRecord',
    component: () => import('@/views/admin/singleRecord/index.vue'),
    meta: {
      title: '单次测试记录',
      role: 'admin',
    },
  },
  {
    path: '/gait',
    name: 'GaitAnalysis',
    component: () => import('@/views/admin/gait/index.vue'),
    meta: {
      title: '步态分析数据',
      role: 'admin',
    },
  },
  {
    path: '/facialExpression',
    name: 'FacialExpression',
    component: () => import('@/views/admin/facialExpression/index.vue'),
    meta: {
      title: '面部表情分析',
      role: 'admin',
    },
  },
  {
    path: '/eyeMovement',
    name: 'EyeMovement',
    component: () => import('@/views/admin/eyeMovement/index.vue'),
    meta: {
      title: '眼动分析',
      role: 'admin',
    },
  },
  {
    path: '/handwriting',
    name: 'Handwriting',
    component: () => import('@/views/admin/handwriting/index.vue'),
    meta: {
      title: '手写笔迹分析',
      role: 'admin',
    },
  },
  {
    path: '/speech',
    name: 'Speech',
    component: () => import('@/views/admin/speech/index.vue'),
    meta: {
      title: '语音分析',
      role: 'admin',
    },
  },
  {
    path: '/semantic',
    name: 'Semantic',
    component: () => import('@/views/admin/semantic/index.vue'),
    meta: {
      title: '语义分析',
      role: 'admin',
    },
  },
]

export const userRoutes: RouteRecordRaw[] = [
  {
    path: '/confirm',
    name: 'Confirm',
    component: () => import('@/views/user/confirm/index.vue'),
    meta: {
      title: '基础信息确认',
      role: 'user',
    },
  },
  {
    path: '/gesture',
    name: 'Gesture',
    component: () => import('@/views/user/gesture/index.vue'),
    meta: {
      title: '姿态识别',
      role: 'user',
    },
  },
  {
    path: '/audioInteractive',
    name: 'AudioInteractive',
    component: () => import('@/views/user/audioInteractive/index.vue'),
    meta: {
      title: '语音交互',
      role: 'user',
    },
  },
  {
    path: '/videoInteractive',
    name: 'VideoInteractive',
    component: () => import('@/views/user/videoInteractive/index.vue'),
    meta: {
      title: '视频交互',
      role: 'user',
    },
  },
  {
    path: '/finish',
    name: 'Finish',
    component: () => import('@/views/user/finish/index.vue'),
    meta: {
      title: '测试结束',
      role: 'user',
    },
  },
]
